package com.ruibang.glass.purchase.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruibang.glass.purchase.domain.req.PurchaseApprovalReq;
import com.ruibang.glass.purchase.domain.req.PurchaseDullnessReq;
import com.ruibang.glass.purchase.entity.PurchaseApprovalList;
import com.ruibang.glass.purchase.entity.PurchaseRequestItems;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 采购审批列表 Mapper 接口
 * </p>
 *
 * @author mameng
 * @since 2024-04-17
 */
@Mapper
public interface PurchaseApprovalListMapper extends BaseMapper<PurchaseApprovalList> {

    String getSequenceNumber();

    PurchaseApprovalList getByNumber(@Param("number") String number);

   Page<PurchaseApprovalList> dullnessList(Page<PurchaseApprovalList> page, @Param("orderIds") List<String> orderIds, @Param("approveIds") List<String> approveIds, @Param("approveOverIds") List<String> approveOverIds, @Param("purchaseDullnessReq") PurchaseDullnessReq purchaseDullnessReq);

    void updateByNumber(@Param("number") String number);

    void updateReportByNumber(@Param("number") String number,@Param("status") String status);

    String getUsedByNumber(@Param("number") String number);

    IPage<PurchaseApprovalList> queryPage(Page<PurchaseApprovalReq> page, @Param("approvalReq") PurchaseApprovalReq managementReq);

    List<PurchaseRequestItems> queryByApplyNumber(@Param("applyNumber") String applyNumber);

    List<PurchaseApprovalList> getFrameContractsProject();

    void updateApprovalSupplier(@Param("projectNumber") String projectNumber,@Param("supplierId")  String supplierId,@Param("isUsed") String isUsed);

    String getFrameUsedByNumber(@Param("number") String number);
}
